<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AsciiDoc Renderer</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/asciidoctor/2.2.0-beta.3/asciidoctor.min.js"></script>
</head>
<body>
    <div id="adoc-content"></div>

    <script>
        // 创建 Asciidoctor 实例
        const asciidoctor = Asciidoctor();

        // 获取 adoc 文件的 URL
        const adocFileUrl = 'README.adoc';

        // 使用 fetch 加载 .adoc 文件内容
        fetch(adocFileUrl)
            .then(response => response.text())
            .then(adocContent => {
                // 渲染 AsciiDoc 内容为 HTML
                const htmlContent = asciidoctor.convert(adocContent);

                // 插入 HTML 内容到页面中
                document.getElementById('adoc-content').innerHTML = htmlContent;
            })
            .catch(error => {
                console.error('Error loading AsciiDoc file:', error);
            });
    </script>
</body>
</html>

